Part Number Hot Search : 
CP200 FSM893S 04001 7108M BDXXKA5W PT200KN8 TC140 C1500
Product Description
Full Text Search
 

To Download AN841 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  AN841/1095 1/8 application note a clock design using the st6-realizer introduction today clock systems are used in more and more applications because of the added features they open: current time display, event dating, process start time programming,... generally, this feature is part of a more global system, and cost effective solutions are required. mcu solutions are more and more often used thanks to the onboard provided timer and all the possibili- ties offered by the mcu embedded resources to manage other tasks. this approach allows single chip so- lutions which brings a great advantage in fields like small home appliances. a simple time of day clock, provided with an alarm feature, has then been developed as example with the help of the st6-realizer . by olivier rouy
2/8 a clock design using the st6-realizer 1 application overview the clock system provides the following features: current time counting alarm triggering at a defined time current time setup alarm time setup the time values are represented in the hh:mm format, but the described concept can easily be extended to representation in seconds. by using this hh:mm format, the time value is represented by a pair of inte- ger variables ranging in [0..59] for the minutes and [0..23] for the hours. the user interface consists of 4 keys:time setup, alarm setup, hours and minutes. with these 4 keys, both the current time and the alarm time can be adjusted: when the key time setup is activated, the hours (resp. minutes) variable of the current time is in- creased at each activation of the key hours (resp. minutes). when the key alarm setup is activated, the hours (resp. minutes) variable of the alarm time is in- creased at each activation of the key hours (resp. minutes). a decrementation of any of the time variables is achieved by successive incrementations since they are reset when they reach the maximum value (23 for the hours and 59 for the minutes). for instance, passing from 22 hours to 2 hours needs 4 steps: 22 > 23 > 0 > 1 > 2.
3/8 a clock design using the st6-realizer 2 functional principle all the featured functions of the clock system are managed on the final application under software control by the mcu. however, using the st6-realizer allows to generate this application software by function- al description of the system. thus the software development can be achieved by a system oriented or hardware like description. 2.1 current time counting the system uses a 1 hz timebase generated with the embedded timer of the st62 mcu. this oscillating timebase is used to trigger three chained modulo-n counters (unit counter): one for the seconds (n = 60) one for the minutes (n = 60) one for the hours (n = 24). when any of these unit counter reaches its maximum value, a clock is issued to increment the unit coun- ter of the next stage. 2.2 current time setup the current time value is modified by incrementation of the counters used for the current time counting. this is achieved by duplicating the clock input of the involved counter directly in the current time counting block. practically, two different additional clocks are needed, one for the minutes incrementation and one for the hours incrementation. each of these additional clocks is controlled by the combination of the keys, time setup, hours and minutes. 2.3 alarm time setup a structure very close to the current time setup has been used. two counters are used, one for the min- utes, and one for the hours. unlike current time counting, the content of these counters can be modified only by pressure on the keys alarm setup, hours and minutes. 2.4 alarm triggering an alarm process is launched when the current time is equal to the alarm predefined time. the occurrence is enabled by a double comparison: hours equal, minutes equal. figure 1. application block diagram current time computing vr02064a alarm time setup comparison timebase user interface time setup alarm setup hours minutes hour, min setup hour, min alarm setup 2 2 2 2
4/8 a clock design using the st6-realizer 3 practical realisation 3.1 timebase the timebase is described by using the oscillator component of the st6-realizer library. any areal- timeo value can be defined for the period in a very explicit way. in the present case, the 1hz timebase is defined as an oscillating squarewave with half a period (level high duration) of 00:00:00.50 in the hh:mm:ss.xx format (figure 2). practically, the st6-realizer uses the embedded timer of the st62 mcu as timebase, and generates by software any periodic variable. figure 2. timebase description 3.2 current time counting each of the 3 chained modulo-n counters presents: an input clock issued from the previous stage (timebase for the 1st stage). an output clock to activate the following stage. a bytewise output with the current counted value (second, minute or hour). an optional clock for the incremental set-up process. any content change can be performed only during a input clock transition from 0 to 1. thus the reset phase when the counter reaches its maximum value has to be anticipated. for instance the hours modu- lo-24 counter is reset if the two following conditions occur: content equal to 23 and input clock transition. in parallel, the resulting reset signal is issued as output clock to increment the next stage as shown on the figure 3 in the case of a modulo-5 counter. figure 3. clock synchronism principle vr02064c clkin value clkout
5/8 a clock design using the st6-realizer each modulo n block is based on a counter component provided within the st6-realizer standard li- brary. this symbol presents the advantage of generating a numeric variable as output. this means that any numeric or arithmetic operation can be directly performed on that variable without worrying on its bi- nary representation. in the present case, the detection of the maximum value is achieved with a compa- rator symbol. the comparator output is injected into the feedback loop at the falling edge of the input clock. this avoids any parasitic preset during the high level of the input clock when the comparator output switches to high level. in parallel, the counter incrementation is prevented by forcing to low level the up input of the coun- ter. finally, each unit counter is represented in the st6-realizer environment as shown in the figure 4. figure 4. unit counter description figure 5. waveforms of the current time counters vr02064b clkin a=b=c q val n-1 n pr 0
6/8 a clock design using the st6-realizer 3.3 current time setup the incrementation clock ( up input of the symbol) is duplicated through an or gate with an external clock, setup signal, for hours or minutes setup. any activation on this clock increments of 1 the content of the counter (figure 6). figure 6. current time setup with a duplicated clock
7/8 a clock design using the st6-realizer 3.4 alarm time setup as for the current time setup, the alarm time setup is achieved by incrementation of two modulo-n counters, one for the minutes and one for the hours. each of them has his own input clock controlled by the combination of the keys alarm setup, hours and minutes. a feedback loop is still needed to reset the counter when the maximum value is reached but its implemen- tation can be much more simple than in the current time counting blocks. in fact a precise synchronism is not mandatory, and a basic solution can be used (figure 7). figure 7. alarm time setup
8/8 a clock design using the st6-realizer 4 conclusion with the help of the st6-realizer, the basic modules of a time of day clock have been developed. the graphical description facility of the tool allows a modular description of the application, and therefore a progressive development. information furnished is believed to be accurate and reliable. however, sgs-thomson microelectronics assumes no responsibility for the consequences of use of such information nor for any infringement of patents or other rights of third parties which may result from its use. no license is granted by implication or otherwise under any patent or patent rights of sgs-thomson microelectronics. specifications mentioned in this publication are subject to change without notice. this publication supersedes and replaces all information previously supplied. sgs-thomson microelectronics products are not authorized for use as critical components in life support devices or systems without the express written approval of sgs-thomson microelectronics. ? the realizer is a registered trademark of actum solutions ? 19 95 sgs-thomson microelectronics - all rights reserved. purchase of i 2 c components by sgs-thomson microelectronics conveys a license under the philips i 2 c patent. rights to use these components in an i 2 c system is granted provided that the system conforms to the i 2 c standard specification as defined by philips. sgs-thomson microelectronics group of companies australia - brazil - china - france - germany - hong kong - italy - japan - korea - malaysia - malta - morocco - the netherlands - singapore - spain - sweden - switzerland - taiwan - thailand - united kingdom - u.s.a.


▲Up To Search▲   

 
Price & Availability of AN841

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X